import { formatHeader } from 'plugins/utils.js'

export function headerSuccess (state, payload) {
  let header = JSON.parse(payload)
  state.columns = formatHeader(header)
  state.columns.splice(7, 0, {name: 'status', label: '状态', field: 'status'})
}

export function loadTableSuccess (state, payload) {
  state.tableData = payload.results
  state.serverPagination.rowsNumber = payload.count
  state.loading = false
}
